package com.enjoyor.soa.traffic.server.tsms.dubbo.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.enjoyor.soa.traffic.api.dto.tsms.AssessItemsDto;
import com.enjoyor.soa.traffic.api.service.dubbo.tsms.IDubboAssessItemsService;
import com.enjoyor.soa.traffic.core.tsms.domain.AssessItems;
import com.enjoyor.soa.traffic.core.tsms.service.IAssessItemsService;
import com.enjoyor.soa.traffic.util.helper.ReflectHelper;
import com.enjoyor.soa.traffic.util.pojo.Page;
import com.enjoyor.soa.traffic.util.pojo.ResultPojo;

@SuppressWarnings("rawtypes")
@Service(version = "1.0.0", timeout = 4000)
public class DubboAssessItemsService implements IDubboAssessItemsService{

	@Autowired
	private IAssessItemsService iAssessItemsService;
	
	@Override
	public ResultPojo getAssessItemsPage(Page page) {
		// TODO Auto-generated method stub
		ResultPojo resultPojo = new ResultPojo(iAssessItemsService.getAssessItemsPage(page));
		return resultPojo;
	}

	@Override
	public ResultPojo getAssessItemsList() {
		// TODO Auto-generated method stub
		List<AssessItems> list = iAssessItemsService.getAssessItemsList();
		ResultPojo resultPojo = new ResultPojo(ReflectHelper.listToList(list, AssessItemsDto.class));
		return resultPojo;
	}

	@Override
	public ResultPojo addAssessItems(AssessItemsDto assessItemsDto, String personName) {
		// TODO Auto-generated method stub
		iAssessItemsService.addAssessItems(ReflectHelper.beanToBean(assessItemsDto, AssessItems.class),personName);
		ResultPojo resultPojo = new ResultPojo();
		return resultPojo;
	}

	@Override
	public ResultPojo editAssessItems(AssessItemsDto assessItemsDto, String personName) {
		// TODO Auto-generated method stub
		iAssessItemsService.editAssessItems(ReflectHelper.beanToBean(assessItemsDto, AssessItems.class), personName);
		return new ResultPojo();
	}

	@Override
	public ResultPojo deleteAssessItems(String itemsId,String personName) {
		// TODO Auto-generated method stub
		iAssessItemsService.deleteAssessItems(itemsId, personName);
		return new ResultPojo();
	}

}
